<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>血条游戏</title>
    <style>
        .bar{
            width: 200px;
            height: 30px;
            border: 1px solid red;
            border-radius: 7px;
        }
        .bar_in{
            width: 50%;
            height: 30px;
            background-color: red;
        }
        /*鼠标放在父盒子上，子盒子变好看*/
        .bar:hover .bar_in{
            width: 100%;
            transition: width 1s;
        }
    </style>
</head>
<body>
    <div class="bar">
        <div class="bar_in">

        </div>
    </div>
</body>
</html>